<?php

namespace App\Http\Requests\Landscaping;

use Illuminate\Foundation\Http\FormRequest;
use App\Http\Requests\BaseRequest;

class ParkVegetationRequest extends BaseRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'name' => 'required',
            'landscaping_id' => 'required|integer',
            'vegetation_id' => 'required|integer',
            'number' => 'required|integer',
            // 'version' => 'required',
            'unit' => 'required',
            'sign' => 'required'
        ];
    }

    public function messages() 
    {
        return [
            'name.required' => '植被名称不能为空',
            'landscaping_id.required' => '绿化名称id不能为空',
            'landscaping_id.integer' => '绿化名称id只能填写数字',
            'vegetation_id.required' => '植被类型id不能为空',
            'vegetation_id.integer' => '植被类型id只能填写数字',
            'number.required' => '植被数量不能为空',
            'number.integer' => '植被数量只能填写数字',
            'version.required' => '植被规模不能为空',
            'unit.required' => '计量单位不能为空',
            'sign.required' => '植被生长情况不能为空'
        ];
    }
}
